/* 
 * Copyright (c)	Insighten Intelligent Equipment co.,LTD
 * 
 *  Use of this software is controlled by the terms and conditions found
 *  in the license agreement under which this software has been supplied.
 * 
 */
#ifndef SOCK_UTIL_H_
#define SOCK_UTIL_H_

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <fcntl.h>

#include "types.h"
enum {
	SOCK_FLG_CONNECTED = (1<<0),
	SOCK_FLG_DISCONNECT	= (1<<1)
};

typedef struct _SocketAttr {
	int blocking;
	int sock_buf_size;
} SocketAttr;

int set_sock_opt(int fd, SocketAttr *attr);

struct in_addr net_get_ip(char *ifname);
Ret net_set_ifaddr(char *ifname, in_addr_t addr);
#endif /*SOCK_UTIL_H_*/
